//
//  JigSawFeedbackView.h
//  JigSawKiosk
//
//  Created by Stulberg on 10-10-17.
//  Copyright 2010 FruitonLabs. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <Quartz/Quartz.h>

#import "JigSawQTRecordView.h"
#import "FeedbackEmailSender.h"
#import "JigSawKioskTextOutput.h"

#import "JigSawCountDownView.h"
#import "JigSawImageButtonView.h"


@interface JigSawFeedbackView : NSView <NSTextFieldDelegate, NSTextViewDelegate>{
	
	NSTextField *commentLabel;
	NSTextField *commentField;
	NSTextField *nameLabel;
	NSTextField *nameField;
	NSTextField *emailLabel;
	NSTextField *emailField;
	JigSawQTRecordView *recordView;
	NSButton *submitButton;
	NSString *outputDirectoryPath;
	NSString *pathToRecordTo;
	
	NSString *currentMovieName ;  // set to movie being watched for logging purposes
	
	JigSawCountDownView *countdownView ;
	NSTimer *recordTimer ;
	int timeValue ;
	
	JigSawImageButtonView *recordButtonView ;
	JigSawImageButtonView *watchAnotherButtonView ;
	
	BOOL isRecording ;
	BOOL canEdit ;
	
	BOOL editing, commenting ;
	
	id delegate ;
}

@property (nonatomic, retain) NSTextField *commentLabel;
@property (nonatomic, retain) NSTextField *commentField;
@property (nonatomic, retain) NSTextField *nameField;
@property (nonatomic, retain) NSTextField *emailLabel;
@property (nonatomic, retain) NSTextField *emailField;
@property (nonatomic, retain) JigSawQTRecordView *recordView;
@property (nonatomic, retain) NSButton* submitButton;
@property (nonatomic, retain) NSString *outputDirectoryPath;
@property (nonatomic, retain) JigSawCountDownView *countdownView ;
@property (nonatomic, retain) JigSawImageButtonView *recordButtonView ;
@property (nonatomic, retain) JigSawImageButtonView *watchAnotherButtonView ;
@property (nonatomic, retain) NSString *currentMovieName ;

-(void) setPathToRecordTo: (NSString*) aPath ;
-(NSString*) pathToRecordTo;

//@property (nonatomic, retain) CATextLayer *countDownLayer ;

/* ---------------------------------
 Initialization method
 ---------------------------------*/
- (void) setupLayers ;

/* ---------------------------------
 Main methods
 ---------------------------------*/

- (void) saveFeedbackLogEntry;  

/* ---------------------------------
 Record preview start stop methods
 ---------------------------------*/
- (void) stopRecordPreview ;
- (void) startRecordPreview ;

/* ---------------------------------
 Delagate methods
 ---------------------------------*/
- (void)setDelegate:(id)aDelegate ;
- (void)delegatedMethod ;

/* ---------------------------------
 Record Timer
 ---------------------------------*/
- (void) watchAnotherTimerMethod:(NSTimer*)timer ;
- (void) recordTimerMethod:(NSTimer*)timer ;
- (void) stopRecordTimer ;
- (void) startRecordTimer ;
- (void) toggleRecord ;
- (void) startFinishTimer ;

/* ---------------------------------
 Key input testing
 ---------------------------------*/
- (BOOL) isEditing ;
- (BOOL) isCommenting ;

- (void)mouseIn:(NSPoint)loc ;

@end

/* ---------------------------------
 Delegate interface
 ---------------------------------*/
@interface NSObject(FeedbackViewDelegateMethods)
- (void)feedBackCallback:(JigSawFeedbackView *)myJigSawFeedbackView ;
@end


